package com.meilishuo.message.util.respon;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import com.meilishuo.message.util.MisCleint;
import com.meilishuo.message.util.entity.Order.OrderList;
import com.meilishuo.message.util.entity.Order.OrderRequest;
import com.meilishuo.message.util.request.OrderListRequest;

import java.math.BigInteger;
import java.util.TreeMap;

/**
 * Created by chenhting on 15/5/8.
 */
public class OrderListResponse {
    public String getOrderList(OrderListRequest request, String session) {
        TreeMap<String, String> appParams = new TreeMap<String, String>();
        appParams.put("method", "meilishuo.order.list.get");
        appParams.put("page", Long.toString(request.getPage()));
        appParams.put("page_size", Long.toString(request.getPage_size()));
        appParams.put("status", Long.toString(request.getStatus()));
        appParams.put("ctime_start", request.getCtime_start().toString());
        appParams.put("ctime_end", request.getCtime_end().toString());
        appParams.put("session", session);
        String result = MisCleint.excuteApi(appParams);
        JSONObject orderListJsonObject=JSON.parseObject(result);
        if (orderListJsonObject.containsKey("error_response")) {
			return "false";
		}
        return orderListJsonObject.getString("order_list_get_response");
    }
}
